package com.yvtian.pu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yvtian.pu.pojo.PuGoodsReceiptItemsEntity;
import com.yvtian.pu.dao.PuGoodsReceiptItemsMapper;
import com.yvtian.pu.service.PuGoodsReceiptItemsService;
import com.yvtian.utils.StringHelper;
import org.springframework.stereotype.Service;

/**
 * 采购入库明细(pu_goods_receipt_items)表服务实现类
 *
 * @author long
 * @since 2024-06-24 10:26:28
 */
@Service("puGoodsReceiptItemsService")
public class PuGoodsReceiptItemsServiceImpl extends ServiceImpl<PuGoodsReceiptItemsMapper, PuGoodsReceiptItemsEntity> implements PuGoodsReceiptItemsService {

    @Override
    public IPage<PuGoodsReceiptItemsEntity> findByPage(Page<PuGoodsReceiptItemsEntity> page, PuGoodsReceiptItemsEntity puGoodsReceiptItemsEntity) {
        LambdaQueryWrapper<PuGoodsReceiptItemsEntity> queryWrapper = new LambdaQueryWrapper<>();
        if (StringHelper.isNotEmpty(puGoodsReceiptItemsEntity.getZcode())) {
            queryWrapper.eq(PuGoodsReceiptItemsEntity::getZcode, puGoodsReceiptItemsEntity.getZcode());
        }
        return this.page(page, queryWrapper);
    }
}

